﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ENG.TeachersDiary.Classes
{
  class SumResult : Result
  {

    public static SumResult Create(List<MarkGroupResult> partialResults)
    {
      SumResult ret = new SumResult();

      ret._Abbr = "Total";
      ret._Title = "Výsledná";

      foreach (var fItem in partialResults)
      {
        double val;
        val = fItem.Sum;
        ret._Sum += val;
        val = fItem.Weight;
        ret._Weight += val;
      } // foreach (var fItem in partialResults)

      return ret;
    }
    private string _Title;
    public override string Title
    {
      get { return _Title; }
    }

    private string _Abbr;
    public override string Abbr
    {
      get { return _Abbr; }
    }

    private double _Sum;
    public override double Sum
    {
      get { return _Sum; }
    }

    private double _Weight;
    public override double Weight
    {
      get { return _Weight; }
    }

  }
}
